/*
 * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OT_DAAF_H
#define OT_DAAF_H

#include "ot_af_common.h"

typedef struct {
    td_s64  timestamp;
    /* Calculated object distance (in millimeters). */
    td_s32  distanceInMilliMeters;
    /* Confidence of measured distance. */
    td_u32  confidence;
    /* Near end of measured distance (in millimeters (when the TOF is semi-confident). */
    td_s32  nearLimit;
    /* Far end of the measured distance in millimeters (when the TOF is semi-confident). */
    td_s32  farLimit;
    /* Maximum distance that can be measured. */
    td_s32  maxDistance;
    /* Indicates whether the data is valid. */
    td_bool isValid;
    /* status code from TOF sensor (255 means no reflection) */
    td_s32  statusCode;
} OT_AF_DAAF_DepthInfoDesc;

typedef struct {
    OT_AF_AlgInfo info;
    td_s32 (*init)(td_void **handle, td_u32 pipe);
    td_s32 (*deinit)(td_void *handle);
    td_s32 (*calculateDepth)(td_void *handle, const OT_AF_WindowConfig *winConfig,
        OT_AF_DAAF_DepthInfoDesc *result);
} OT_AF_DAAFAlgIntf;

OT_AF_DAAFAlgIntf *SS_DAAF_GetDAAFAlg(td_void);

#endif
